﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CMSModel;

public partial class Topics_AddType : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
       
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        TopicsType type = new TopicsType();
        type.Desc = txtDesc.Text;
        type.Name = txtName.Text;
        type.ID = txtType.Text;
        CMSEntities cms = new CMSEntities();
        cms.TopicsType.AddObject(type);
        cms.SaveChanges();
        ClientScript.RegisterStartupScript(GetType(), "aa", "alert('添加成功');document.location='Default.aspx';",true);

    }   
}